package cn.iocoder.yudao.module.member.service.order;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.order.vo.CertificateOrderCountTypeVo;
import cn.iocoder.yudao.module.member.controller.admin.order.vo.CertificateOrderCountUserVo;
import cn.iocoder.yudao.module.member.controller.admin.order.vo.CertificateOrderCountVo;
import cn.iocoder.yudao.module.member.controller.app.order.vo.AppMemberCertificateOrderRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.app.order.vo.AppMemberCertificateOrderVo;
import cn.iocoder.yudao.module.member.controller.app.order.vo.UpdateRemarkReqVO;
import cn.iocoder.yudao.module.member.controller.app.order.vo.UpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.order.MemberCertificateOrderDo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;

public interface CertificateOrderService {
    MemberCertificateOrderDo createOrder(AppMemberCertificateOrderVo appOrderVo) throws Exception;

    PageResult<MemberCertificateOrderDo> getCertifiOrdeRecordPage(Long loginUserId, AppMemberCertificateOrderRecordPageReqVO pageReqVO);

    /**
     * 证书上传
     * @param updateReqVO
     */
    void updateOrderLink(UpdateReqVO updateReqVO);

    /**
     * 修改备注
     * @param updateRemarkReqVO
     */
    void updateOrderRemark(UpdateRemarkReqVO updateRemarkReqVO);

    void deleteById(Long id);

    BigDecimal queryPrice(AppMemberCertificateOrderVo appOrderVo);

    CertificateOrderCountVo queryCount();

    CertificateOrderCountTypeVo queryCountByType();

    /**
     * 证书排行
     * @return
     */
    CertificateOrderCountUserVo CertificateOrderCountUserVo(String flag);


    /**
     * 下载证书
     */
    void downloadCertificate(HttpServletRequest request, HttpServletResponse response) throws Exception;

    void downloadCertificateCheck(HttpServletRequest request, HttpServletResponse response) throws Exception;
    MemberCertificateOrderDo getByUdidAndUserId(String udid,Long userId);

    List<MemberCertificateOrderDo> getListByUserAndUdid(Long userId, String udid);

    void loadDevice(UpdateReqVO updateReqVO) throws Exception;

    MemberCertificateOrderDo getById(Long id);

    void updateById(MemberCertificateOrderDo memberCertificateOrderDo);

    /**
     * 其他系统文件转换处理
     */
    void excuteSignTask();

    BigDecimal queryMyPrice(AppMemberCertificateOrderVo appOrderVo);

    /**
     * B系统掉A系统的接口
     * @param appOrderVo
     * @return
     */
//    MemberCertificateOrderDo createOrderByOther(AppMemberCertificateOrderVo appOrderVo);
}
